<?php 

if ( !current_user_can('publish_posts')) {
	 echo 'ingen tilgang.';
	} 
        else {
?>


<?php

 global $hide_right_sidebar;
$hide_right_sidebar = true;
    
//----------brukt info fra http://voodoopress.com/how-to-post-from-your-front-end-with-no-plugin/
// END THE IF STATEMENT THAT STARTED THE WHOLE FORM
//POST THE POST YO
do_action('wp_insert_post', 'wp_insert_post');
//--------------------------------

        
//wp_insert_post($postarr);
 ?>




<form action="" id="new_post" name="new_post" method="POST" enctype="multipart/form-data">
 
    <fieldset name ="name">
        <label for="title"><?php _e('Nyhets tittel:', 'framework') ?></label>
 
        <input type="text" name="title" id="title" class="required" />
    </fieldset>
 
    <fieldset class="content">
        <label for="textarea01"><?php _e('Innhold:', 'framework') ?></label>
        
        <?php  wp_editor('', 'description'); ?>
        <!--<textarea name="postContent" id="postContent" rows="8" cols="30" class="required"></textarea>-->
    </fieldset>
    <fieldset class="category">
        <label for="kategorier"></br>Kategori: </label>
    <?php wp_dropdown_categories( 'show_option_none=Ikke Valgt&tab_index=4&taxonomy=category&hide_empty=0' ); ?>
    </fieldset
    <fieldset class="tags">
        <label for="post_tags">Søkeord for nyheten (separert med komma): </label>
        <input type="test" value="" tabindex="35" name="post_tags" id="post_tags"/>
    </fieldset>
    <fieldset class="submit">
        <input type="hidden" name="submit" id="submit" value="true" />
 
        <button type="submit"  >Legg til nyhet</button>
    </fieldset>
    <input type="hidden" name="action" value="Legg Til"/>
    <?php        wp_nonce_field('new_post'); ?>
</form>


        <?php } ?>

